<!doctype html>



  


<html class="theme-next pisces use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Android," />





  <link rel="alternate" href="/atom.xml" title="GrantonZhuang's Blog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="前言RoBoGuice 和 ButterKnife 都是 Android 开发中常用的运行时注解框架，可以提高开发速度，帮助开发者省去重复繁琐的步骤，让代码更加优雅，这篇文章的主要内容是两者之间的区别。">
<meta property="og:type" content="article">
<meta property="og:title" content="注解框架RoBoGuice和ButterKnife的对比">
<meta property="og:url" content="https://grantonzhuang.github.io/2016/05/01/注解框架RoBoGuice和ButterKnife的对比/index.html">
<meta property="og:site_name" content="GrantonZhuang's Blog">
<meta property="og:description" content="前言RoBoGuice 和 ButterKnife 都是 Android 开发中常用的运行时注解框架，可以提高开发速度，帮助开发者省去重复繁琐的步骤，让代码更加优雅，这篇文章的主要内容是两者之间的区别。">
<meta property="og:updated_time" content="2016-07-29T13:56:02.584Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="注解框架RoBoGuice和ButterKnife的对比">
<meta name="twitter:description" content="前言RoBoGuice 和 ButterKnife 都是 Android 开发中常用的运行时注解框架，可以提高开发速度，帮助开发者省去重复繁琐的步骤，让代码更加优雅，这篇文章的主要内容是两者之间的区别。">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: '博主'
    }
  };
</script>




  <link rel="canonical" href="https://grantonzhuang.github.io/2016/05/01/注解框架RoBoGuice和ButterKnife的对比/"/>

  <title> 注解框架RoBoGuice和ButterKnife的对比 | GrantonZhuang's Blog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">GrantonZhuang's Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle"></p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/index.html" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/index.html" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/index.html" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                注解框架RoBoGuice和ButterKnife的对比
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2016-05-01T13:34:34+08:00" content="2016-05-01">
              2016-05-01
            </time>
          </span>

          

          
            
          

          

          
          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p><code>RoBoGuice</code> 和 <code>ButterKnife</code> 都是 Android 开发中常用的运行时注解框架，可以提高开发速度，帮助开发者省去重复繁琐的步骤，让代码更加优雅，这篇文章的主要内容是两者之间的区别。</p>
<a id="more"></a>
<h2 id="RoBoGuice-的功能概览"><a href="#RoBoGuice-的功能概览" class="headerlink" title="RoBoGuice 的功能概览"></a>RoBoGuice 的功能概览</h2><blockquote>
<p>注：以下功能都需要在 <code>RoboActivity</code> 的子类或者 <code>RoboFragment</code> 的子类中使用。</p>
</blockquote>
<ul>
<li>布局<ul>
<li><code>@ContentView(layoutID)</code></li>
</ul>
</li>
<li>视图<ul>
<li><code>@InjectView(viewID) View view</code></li>
</ul>
</li>
<li>资源文件<ul>
<li><code>@InjectView(resourceID) Resource res</code></li>
</ul>
</li>
<li>系统服务<ul>
<li><code>@Inject SystemService systemService</code></li>
</ul>
</li>
<li>POJO 的构造函数<ul>
<li><code>@Inject</code></li>
</ul>
</li>
<li>POJO<ul>
<li><code>@Inject Foo foo;</code></li>
<li>需要先注解对应的　POJO　类的构造函数</li>
</ul>
</li>
<li>Application 单例<ul>
<li><code>@Singleton</code></li>
<li>随应用结束而销毁</li>
</ul>
</li>
<li>Context 单例<ul>
<li><code>@ContextSingleton</code></li>
<li>当 Context 对象被回收，单例一起被回收</li>
</ul>
</li>
<li>Fragment 单例<ul>
<li><code>@FragmentSingleton</code></li>
<li>当 Fragment 对象被回收，单例一起被回收</li>
</ul>
</li>
<li>接口，抽象类的实现类<ul>
<li><code>@Inject IFoo foo</code></li>
<li>需要在 <code>AndroidManifest.xml</code> 文件中注册自定义的模块，该模块需要继承自 <code>AbstractModule</code>，调用 <code>bind(IFoo.class).to(Foo.class)</code> 方法绑定接口（或者抽象类）和实现类，题外话，这点和 <code>Laravel</code> 的依赖注入方式有点类似啊</li>
</ul>
</li>
<li>Service<ul>
<li>继承 <code>RoboService</code>, 在 Service 中使用 <code>RoBoGuice</code> 的其他注解</li>
</ul>
</li>
<li>BroadcastReceiver<ul>
<li>不需要改变继承结构,在 <code>BroadcastReceiver</code> 中自由地使用 <code>RoBoGuice</code> 的其他注解，但是需要注意，在 <code>BroadcastReceiver</code> 中的 <code>Context</code> 或者 <code>Fragment</code> 单例都会被转换成全局单例</li>
</ul>
</li>
<li>单元测试<ul>
<li><a href="https://github.com/roboguice/roboguice/wiki/Your*First*Testcase" target="_blank" rel="external">官方文档</a></li>
</ul>
</li>
<li>自定义 View<ul>
<li>在构造函数中调用 <code>RoboGuice.getInjector(getContext()).injectMembers(this);</code> 以告知 <code>RoboGuice</code> 处理该类的注解</li>
<li>实现方式与 POJO 中的注解没有区别</li>
</ul>
</li>
<li>ContentProvider<ul>
<li><a href="https://github.com/roboguice/roboguice/wiki/Your*First*Injected*ContentProvider" target="_blank" rel="external">官方文档</a></li>
<li>使用 <code>AbstractModule</code> 子类，<code>@Provides</code> 注解, <code>@Named</code> 提供特定的 Uri 实例</li>
<li>需要在 <code>AndroidManifest.xml</code> 文件中声明 <code>provider</code></li>
</ul>
</li>
<li>注入事件<ul>
<li><a href="https://github.com/roboguice/roboguice/wiki/Using*Events*in*your*RoboGuice*application" target="_blank" rel="external">官方文档</a></li>
<li>在同一个 Context 或者不同的 Context 中传递和处理事件</li>
</ul>
</li>
<li>日志<ul>
<li><code>Ln.v()</code>, <code>Ln.d()</code> 等</li>
<li>会打印出一些日志之外的信息，如时间戳，线程信息和其他有用的信息，是一个非常棒的 <code>Log</code> 辅助</li>
</ul>
</li>
</ul>
<h2 id="ButterKnife-的功能概览"><a href="#ButterKnife-的功能概览" class="headerlink" title="ButterKnife 的功能概览"></a>ButterKnife 的功能概览</h2><blockquote>
<p>注：需要调用 <code>ButterKnife.bind(target)</code> 进行绑定;</p>
</blockquote>
<ul>
<li>视图<ul>
<li><code>@BindView(viewID) View view</code></li>
</ul>
</li>
<li>多个视图<ul>
<li><code>@BindViews({ viewID, viewID...}) List&lt;View&gt; views;</code></li>
</ul>
</li>
<li>字符串资源<ul>
<li><code>@BindString(stringID) String string</code></li>
</ul>
</li>
<li>图片资源<ul>
<li><code>@BindDrawable(drawableID) Drawable drawable</code></li>
<li>其他资源如 <code>Dimen</code>, <code>Color</code>类似</li>
</ul>
</li>
<li>对象属性<ul>
<li>ButterKnife.apply(view, ButterKnife.Action<view>, value)`</view></li>
<li>其中<code>ButterKnife.Action&lt;View&gt;</code> 也可以是 Android　原生 API 的中的 <code>Property</code></li>
</ul>
</li>
<li>点击事件<ul>
<li><code>@OnClick(viewId) void onClick(View view)</code></li>
<li>同样可以绑定多个视图到一个方法中</li>
<li>同时 <code>OnItemSelected</code> <code>OnCheckedChanged</code>…　等其他的事件都可以绑定，具体见 <a href="http://jakewharton.github.io/butterknife/javadoc/" target="_blank" rel="external">官方文档</a></li>
</ul>
</li>
</ul>
<h2 id="RoBoGuice-小结"><a href="#RoBoGuice-小结" class="headerlink" title="RoBoGuice 小结"></a>RoBoGuice 小结</h2><ul>
<li><p><code>RoBoGuice</code> 的功能非常全面，可以绑定视图，资源文件，Android 四大组件，Fragment，日志，单元测试等，此外还包含有单例对象，以声明的方式指定接口的实现类，甚至能够绑定组件的生命周期事件，以及开发者自定义的事件。</p>
</li>
<li><p>在开发过程中，会变得很少看到构造函数，或者是 <code>getSystemService()</code> 之类的方法，也可以省去很多空值检查，因为 <code>RoBoGuice</code> 将这些重复的步骤都抽象起来，放在了 <code>RoboActivity</code> 或者 <code>RoboFragment</code> 中实现，开发者只要继承特定的父类以及加上特定的注解，就可以省去这些繁琐的业务无关的代码。</p>
</li>
<li><p>因此，<code>RoBoGuice</code> 对代码的入侵也非常大，基本上囊括了 Android 开发中需要的所有的辅助功能。</p>
<ul>
<li>绑定视图代替 <code>findViewById()</code>，</li>
<li>使用 <code>AbstractModule</code> 绑定接口的实现类可以代替工厂等，</li>
<li>绑定了各种事件，也可以将项目中的 <code>EventBus</code> 去掉了,</li>
</ul>
</li>
<li><p>占据父类，Activity 和 Fragment 都需要继承特定的父类。</p>
</li>
</ul>
<h2 id="ButterKnife-小结"><a href="#ButterKnife-小结" class="headerlink" title="ButterKnife 小结"></a>ButterKnife 小结</h2><ul>
<li><code>ButterKnife</code> 的功能侧重点在于视图，和视图的属性，事件，对于其他则并不关心，对代码的入侵非常小，因此可以和其他的框架组合在一起使用。</li>
</ul>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>可以看出，<code>RoBoGuice</code> 相比 <code>ButterKnife</code>，功能多出不少，甚至可以说后者只是前者的一小部分，但是 <code>ButterKnife</code> 在视图这一块做的比 <code>RoBoGuice</code> 更加的细致。</p>
<p>两个框架的哲学也不尽相同，<code>RoBoGuice</code> 控制着整个应用的整体架构，充满了面向对象，依赖注入的思想。而 <code>ButterKnife</code> 更像是一个精细的辅助小工具。</p>
<h2 id="附：题外话，RoBoGuice-的依赖注入和-Laravel-的依赖注入的比较"><a href="#附：题外话，RoBoGuice-的依赖注入和-Laravel-的依赖注入的比较" class="headerlink" title="附：题外话，RoBoGuice 的依赖注入和 Laravel 的依赖注入的比较"></a>附：题外话，RoBoGuice 的依赖注入和 Laravel 的依赖注入的比较</h2><h3 id="RoBoGuice-的依赖注入："><a href="#RoBoGuice-的依赖注入：" class="headerlink" title="RoBoGuice 的依赖注入："></a>RoBoGuice 的依赖注入：</h3><ul>
<li>接口和实现类的声明：</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">interface</span> <span class="title">IFoo</span> </span>&#123;&#125;</div></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Foo</span> <span class="keyword">implements</span> <span class="title">IFoo</span> </span>&#123;&#125;</div></pre></td></tr></table></figure>
<ul>
<li>在 <code>AbstractModule</code> 中绑定接口和实现类</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">package</span> com.example;</div><div class="line"></div><div class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">MyModule</span> <span class="keyword">extends</span> <span class="title">AbstractModule</span> </span>&#123;</div><div class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">bind</span><span class="params">()</span> </span>&#123;</div><div class="line">        bind(IFoo.class).to(Foo.class);</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<ul>
<li>在 <code>AndroidManifest.xml</code> 中声明这个模块</li>
</ul>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">application</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">meta-data</span></span></div><div class="line">        <span class="attr">android:name</span>=<span class="string">"roboguice.modules"</span></div><div class="line">        <span class="attr">android:value</span>=<span class="string">"com.example.MyModule"</span> /&gt;</div><div class="line"><span class="tag">&lt;/<span class="name">application</span>&gt;</span></div></pre></td></tr></table></figure>
<h3 id="Laravel-的依赖注入："><a href="#Laravel-的依赖注入：" class="headerlink" title="Laravel 的依赖注入："></a>Laravel 的依赖注入：</h3><ul>
<li>接口和实现类的声明</li>
</ul>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">namespace</span> <span class="title">APP</span>\<span class="title">Contracts</span></div><div class="line"><span class="title">interface</span> <span class="title">FooContract</span> &#123;&#125;</div></pre></td></tr></table></figure>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">namespace</span> <span class="title">APP</span>\<span class="title">Service</span></div><div class="line"><span class="title">class</span> <span class="title">FooService</span> <span class="title">implements</span> <span class="title">FooContract</span> &#123;&#125;</div></pre></td></tr></table></figure>
<ul>
<li>在 <code>ServiceProvider</code> 中进行绑定</li>
</ul>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">namespace APP\Providers</div><div class="line">class FooProvider extends ServiceProvider &#123;</div><div class="line">    public function register() &#123;</div><div class="line">    	$this-&gt;app-&gt;bind(</div><div class="line">        	'App\Contracts\FooContract',</div><div class="line">            'App\Services\FooService'</div><div class="line">        );</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<ul>
<li>在 <code>config/app.php</code> 中声明该 Provider</li>
</ul>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="string">'providers'</span> =&gt; [</div><div class="line">    <span class="string">'App\Providers\FooProvider'</span></div><div class="line">]</div></pre></td></tr></table></figure>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Android/" rel="tag">#Android</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/04/24/BlurImageView的基本使用和源码解析/" rel="next" title="BlurImageView的基本使用和源码解析">
                <i class="fa fa-chevron-left"></i> BlurImageView的基本使用和源码解析
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2016/05/08/Realm初步实践１/" rel="prev" title="Realm初步实践１">
                Realm初步实践１ <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="http://ww1.sinaimg.cn/mw690/6e8939a6gw1f3g1u1mc6lj20hs0hsmxf.jpg"
               alt="Granton Zhuang" />
          <p class="site-author-name" itemprop="name">Granton Zhuang</p>
          <p class="site-description motion-element" itemprop="description"></p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives/index.html">
              <span class="site-state-item-count">26</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">11</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#RoBoGuice-的功能概览"><span class="nav-number">2.</span> <span class="nav-text">RoBoGuice 的功能概览</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#ButterKnife-的功能概览"><span class="nav-number">3.</span> <span class="nav-text">ButterKnife 的功能概览</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#RoBoGuice-小结"><span class="nav-number">4.</span> <span class="nav-text">RoBoGuice 小结</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#ButterKnife-小结"><span class="nav-number">5.</span> <span class="nav-text">ButterKnife 小结</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#总结"><span class="nav-number">6.</span> <span class="nav-text">总结</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#附：题外话，RoBoGuice-的依赖注入和-Laravel-的依赖注入的比较"><span class="nav-number">7.</span> <span class="nav-text">附：题外话，RoBoGuice 的依赖注入和 Laravel 的依赖注入的比较</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#RoBoGuice-的依赖注入："><span class="nav-number">7.1.</span> <span class="nav-text">RoBoGuice 的依赖注入：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Laravel-的依赖注入："><span class="nav-number">7.2.</span> <span class="nav-text">Laravel 的依赖注入：</span></a></li></ol></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Granton Zhuang</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>

        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.0.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  



  




  
  

  

  

  

</body>
</html>
